/*
 * maz_drv_i2c.h
 *
 *  Created on: 2020年7月17日
 *      Author: ChenBlue
 */

#ifndef INC_MAZ_DRV_I2C_H_
#define INC_MAZ_DRV_I2C_H_

#include "maz_drv.h"

typedef enum _MAZDRV_E_I2C_
{
    MAZDRV_E_I2C1 = 0,
    MAZDRV_E_I2C2,
    MAZDRV_E_I2C3,
    MAZDRV_E_I2C_MAX,
} MAZDRV_E_I2C;

typedef enum _MAZDRV_E_I2C_IOMAP_
{
    MAZDRV_E_I2C1_IOMAP1_PB6_PB7 = 0,        /* I2C1 */
    MAZDRV_E_I2C1_IOMAP2_PB8_PB9,
    MAZDRV_E_I2C2_IOMAP1_PB10_PB3,           /* I2C2 */
    MAZDRV_E_I2C3_IOMAP1_PA8_PB4,            /* I2C3 */
} MAZDRV_E_I2C_IOMAP;

typedef enum _MAZDRV_E_I2C_USE_
{
    MAZDRV_E_I2C_USE_DISABLE = 0,
    MAZDRV_E_I2C_USE_ENABLE,
} MAZDRV_E_I2C_USE;

typedef struct _MAZDRV_I2C_CFG_
{
    MAZDRV_E_I2C_IOMAP  iomap;                  // 引脚映射
    I2C_HandleTypeDef   conf;                    // I2C配置
} MAZDRV_I2C_CFG;

typedef struct _MAZDRV_I2C_CTRLL_
{
    MAZDRV_E_I2C_USE use;                      // 是否启用
    MAZDRV_I2C_CFG cfg;
} MAZDRV_I2C_CTRL;

int MAZ_Drv_i2c_init(void);

#endif /*INC_MAZ_DRV_I2C_H_*/
